<?php
class control_api extends core_action{
	
	public $params;
	
	function getCate(){
		$pid = intval($_REQUEST['pid']);
		if($pid == 0) return json_encode(array('state'=>1,'html'=>''));
		$model = new core_model_cate();
		$rs = $model->select(array('pid'=>$pid),'cate_name,cid')->items;
		$str = '';
		if($rs){
			foreach ($rs as $v){
				$str .= "<option value='{$v['cid']}'>{$v['cate_name']}</option>";
			}
		}else{
			
		}
		return json_encode(array('state'=>1,'html'=>$str));
	}
	
}